@extends('user._layouts.default')

@section('css')
    {{HTML::style('user/css/base.css')}}
@stop

@section('user-main')
<div style="font-size: 25px;">{{{$title or ''}}}<a href="{{URL::to('user/projects')}}" class="am-btn am-fr am-btn-xs am-btn-primary">我的软件</a></div>
<hr/>

  @if(Session::has('message'))
      <div class="am-alert am-alert-{{Session::get('message')['type']}} am-margin am-text-center" data-am-alert>{{Session::get('message')['content']}}</div>
  @endif
  @if($errors->has())
      <div class="am-alert am-alert-danger am-margin am-text-center" data-am-alert>{{$errors->first()}}</div>
  @endif
  {{Form::model($project,array('url'=>'user/projects/domodify','method'=>'post','class'=>'am-form am-form-horizontal am-margin-top-lg'))}}
  <div class="am-form-group">
  <div class="am-form-group">
    {{Form::label('name','软件名称',array('class'=>'am-u-sm-2 am-form-label'))}}
    <div class="am-u-sm-10">
      {{Form::text('name')}}
    </div>
  </div>

  <div class="am-form-group">
    {{Form::label('home_url','软件主页',array('class'=>'am-u-sm-2 am-form-label'))}}
    <div class="am-u-sm-10">
      {{Form::text('home_url')}}
    </div>
  </div>
  <div class="am-form-group">
    {{Form::label('doc_url','文档地址',array('class'=>'am-u-sm-2 am-form-label'))}}
    <div class="am-u-sm-10">
      {{Form::text('doc_url')}}
    </div>
  </div>
  <div class="am-form-group">
    {{Form::label('download_url','下载地址',array('class'=>'am-u-sm-2 am-form-label'))}}
    <div class="am-u-sm-10">
      {{Form::text('download_url')}}
    </div>
  </div>

  <div class="am-form-group">
    {{Form::label('license','授权协议',array('class'=>'am-u-sm-2 am-form-label'))}}
    <div class="am-u-sm-10">
      {{Form::select('license',array('GPL'=>'GPL','Apache'=>'Apache','BSD'=>'BSD'))}}
    </div>
  </div>

  <div class="am-form-group">
    <div class="am-u-sm-12">
      {{Form::textarea('detail','',array('id'=>'detail','style'=>'height:500px;'))}}
    </div>
  </div>
  <div class="am-form-group">
    <div class="am-u-sm-10 am-u-sm-offset-2">
      {{Form::hidden('id')}}
      {{Form::submit('发布软件',array('class'=>'am-btn am-btn-primary'))}}
    </div>
  </div>
{{Form::close()}}


@stop
<!--[if (gte IE 9)|!(IE)]><!-->
@section('js')
<!-- 编辑器源码文件 -->
<script type="text/javascript" src="{{URL::asset('ueditor/ueditor.config.js')}}"></script>
<script type="text/javascript" src="{{URL::asset('ueditor/ueditor.all.js')}}"></script>
<!-- 编辑器源码文件 -->
<script type="text/javascript">
  //实例化编辑器
  var ue = UE.getEditor('detail');
</script>
@stop
